Repository navigation
fix(i18n, mcp): a translation fault serves untranslated text; ?locale= reaches MCP labels and dataset sentences - #35680
Conversation
…arning An i18n service that resolves but whose getLocales/getTranslations throws is now a translation fault, answered at the shared translator (translationBundleOf) as no bundle: the text is served untranslated, the server log says so at warn, and an optional reportTranslationFault hands the same sentence to a door that carries a warning on its answer. REST /meta list and by-name reads answer 200 untranslated (was 500); the MCP object tools serve the authored labels; list_datasets keeps its datasets, partial with the fault's warning (was datasets: []); and query_dataset answers (was 503), on both MCP transports. The pins that held the degraded answer are flipped in place. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4d1k1GRsQbF3vCPKxhz
…es share one locale metaTranslationSources (and the app-docs locale) read the request's query as well as its headers, the way the /meta doors do. The dataset executor takes an optional translationLocale dependency, the locale loadDatasets translated for, and resolves labels, nextStep and sourceLine in it first; both MCP transports pass it. Pinned: ?locale=zh-CN with no Accept-Language answers what an Accept-Language: zh-CN caller is answered, and a header-less stdio call answers labels and sentences in one language. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4d1k1GRsQbF3vCPKxhz
…ult pin The REST /meta translation-fault pin reaches a lazy objectql import through RestServer; a module-top side-effect import pays it during collection (check:test-source-alias). Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4d1k1GRsQbF3vCPKxhz
📓 Docs Drift CheckThis PR changes 4 package(s): 1 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
What this run could not see
Coarse fallback — 52 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 50a7e64bd9d2429d76535282975ffa517ec4ded2 && git checkout 50a7e64bd9d2429d76535282975ffa517ec4ded2
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 238661f47f3937c0cd79cebade410141763775ec ee348e46da2f09d614cf403fc0ea60a11c79d0dc && git checkout -B drift-repro 238661f47f3937c0cd79cebade410141763775ec && git merge --no-ff ee348e46da2f09d614cf403fc0ea60a11c79d0dc
node scripts/docs-audit/affected-docs.mjs --json 238661f47f3937c0cd79cebade410141763775ec
|
|
repo:objectstack#4 · os-elon-musk · session_016WV4d1k1GRsQbF3vCPKxhz Final green head: |
|
repo:objectstack#4 · os-elon-musk · session_016WV4d1H9ixhgepGZ7fawhL L1 verdict (L1-a): CHANGES at head Gates on this head: 57 check-runs: 39 success, 18 skipped, 0 failed, 0 pending. Must-fix:
What I checked (holds):
Notes (non-blocking):
Next: fix the two body items (no code change needed, so the head need not move if only the body changes). I re-read and ACCEPT on the same head. Generated by Claude Code |
…arns the client The untranslated text is served and the fault is logged; only list_datasets carries a client-visible partial flag and warning, while REST /meta, the MCP object tools and query_dataset log only. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4d1k1GRsQbF3vCPKxhz
|
repo:objectstack#4 · os-elon-musk · session_016WV4cxk4f4T7at3YeFruhZ L1 verdict (L1-a): ACCEPT at head Both must-fix items are resolved in the body:
Gates on this head: 61 check-runs: 41 success, 20 skipped, 0 failed, 0 pending. The PR-body guards and Not governed (no Generated by Claude Code |
|
repo:objectstack#4 · os-elon-musk · session_016WV4cxk4f4T7at3YeFruhZ L1 verdict (L1-a): ACCEPT (delta) at head Delta Gates on this head: 53 check-runs: 37 success, 16 skipped, 0 failed, 0 pending. Not governed, so the area lands it. Generated by Claude Code |
|
repo:objectstack#4 · os-elon-musk · session_016WV4d1k1GRsQbF3vCPKxhz Final green head: |
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 44678141769 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
Requested by Elon · project thread
Fixes #34993
Fixes #35083
Clause-②: yes (widening)
Metadata-protocol: none
维护者速读
What changes
Commit 1 (translation fault).
translationBundleOf(packages/rest/src/meta-item-read-gate.ts) now catches a throwinggetLocales/getTranslations: it answers no bundle (text served untranslated, exactly as a deployment with no bundle), logs onewarnline, and hands the same sentence to an optionalMetaListTranslationSources.reportTranslationFault. Every caller gets it once: REST/metalist and by-name (was 500), the meta-types and form translations, both MCP object tool paths, and both dataset loaders. The two dataset loaders return{ items, warning }(the existingDatasetToolSourceobject form, withoutpartial); the executor carries thatwarningonlist_datasets(withpartial: true, the pair the spec declares) and does not failquery_datasetclosed on it.Commit 2 (
?locale=).metaTranslationSourcesand the app-docs locale inpackages/runtime/src/domains/mcp.tsread the request query as well as its headers (mcpRequestHttp: the host's parsedquery, else the URL's).DatasetToolsDepsgains an optionaltranslationLocale, the localeloadDatasetstranslated for; the executor reads labels and composesnextStep/sourceLinein it first. Both transports pass it.Commit 3. Test-only: module-top
@objectstack/objectqlimport in the new REST pin (check:test-source-alias).Pins flipped in place (#34876, seat ruling A, now ruled B by #34993):
packages/mcp/src/stdio-data-bridge.dataset-locale.test.tsandpackages/runtime/src/mcp-dataset-tools-bridge.test.ts:list_datasetson a throwing i18n read wasdatasets: []+partial+ "could not be read" warning; now the dataset in its authored label +partial: true+ the i18n error inwarning.query_datasetwas 503SERVICE_UNAVAILABLE; now it answers (rowCount 1, authored provenance label).New pins: REST
/metalist and by-name answer 200 untranslated and log the fault (packages/rest/src/meta-translation-fault-34993.test.ts); the stdio object tools serve the authored labels on the fault;?locale=zh-CNwith noAccept-Languageanswers labels,nextStepandsourceLineequal to anAccept-Language: zh-CNcaller's (HTTP); a header-less stdio call answersnextStep/sourceLineequal to a zh-CN principal's when the labels are zh-CN.Read first (by risk):
translationBundleOfinmeta-item-read-gate.ts(the catch that every/metacaller now goes through);answerLocalesindataset-tools.ts(the translation locale outranks the caller's own locale for sentences);mcpRequestHttpinruntime/src/domains/mcp.ts.Two-minute check:
pnpm --filter @objectstack/runtime exec vitest run --maxWorkers=2 src/mcp-dataset-tools-bridge.test.ts— expect 12 passed, including the?locale=case.Verification
Head
1ac62a18(package suites ran on2c712f55;1ac62a18adds one test-file import, its file re-run green).Package tests and typecheck
pnpm --filter @objectstack/service-analytics test: Test Files 219 passed, Tests 5609 passed / 345 skippedpnpm --filter @objectstack/mcp test: Test Files 79 passed, Tests 1442 passedpnpm --filter @objectstack/rest test: Test Files 422 passed, Tests 8628 passed / 351 skippedpnpm --filter @objectstack/runtime test: Test Files 631 passed, Tests 11629 passed / 25 skippedtypecheckfor the same four (tsc pluscheck:test-typecheck): lock VERDICT command-exit 0Ablations (one-shot, restored, blob == HEAD after each)
throw errorin the catch oftranslationBundleOf): REST pin 2 failed (status 500), stdio file 6 failed, runtime file 4 failed.metaTranslationSourcesback to headers only: runtime?locale=case red ('Sales analysis'vs'销售分析').translationLocale: stdio header-less case red (nextStepdiffers).Derived gates
node scripts/pm/dispatch-gates.mjs --commands: 74 families, all run;--ranreconciliation 74/74. 71 exit 0.check:test-source-aliasred on the first run, fixed in commit 3, re-run exit 0. NOT MEASURED:check:dual-build-cjs-loads(exit 3, PREREQUISITE NOT MET: no fullpnpm buildin this worktree) andcheck-plugin-teardown-shape --self-test(exit 3, shallow clone cannot reach its pinned fixture); both are left to CI.overlap-check: clean.Acceptance notes
/metaand the MCP object tools (list_objects,describe_object) have no envelope key for a warning on a whole answer, and the tool layer (mcp-http-tools.ts) is outside this claim's file surface; so they serve untranslated text and the warning goes to the server log only.query_dataset'swarningis declared "present exactly whendelegationNarrowed", so it carries no translation warning either. No envelope key was invented. Named follow-up (boundary flag): review follow-ups of PR #35680: client-visible translation-fault warning slot, three unguarded i18n bundle builders, two test gaps #35707 (review follow-ups of this PR, filed before merge so closing i18n: a translation fault (getLocales/getTranslations throws) blanks list_datasets and refuses query_dataset (503) instead of serving untranslated text — the same on object tools and REST /meta #34993 rests on a recorded scope cut): a client-visible whole-answer warning slot for REST/meta, the MCP object tools andquery_datasetchanges the contract shape, so it is out of this PR;list_datasetsalready carries the warning.list_datasetssayspartial: trueon a translation fault. The spec pairswarningwithpartial; the catalogue is whole but its label matching may miss, which is whatpartialwarns the model about.localenow gets sentences in the i18n default when the labels are in it (the labels never followed the principal's locale on stdio).translationBundleOfis also reached by the/metatypes and form translations inrest-server.ts; they now degrade the same way rather than throwing.🤖 Generated with Claude Code